package com.lisp.springframework.core.aop.aspectj.annotation;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class PrintAspect {

    @Pointcut("execution (public * print(..))")
    public void print() { }
    
    @Pointcut("within(com.lisp.springframework.core.aop.aspectj..*)")
    public void withInAopPackage() { }
    
    @Pointcut("print() && withInAopPackage()")
    public void aopPrint() { }
    
    @After("aopPrint()")
    public void afterPrint() {
        System.out.println("after print advice executed");
    }
}
